core: Ensure .archive-content files are mode 0644
authorColin Walters <walters@verbum.org>
Thu, 23 Feb 2012 17:34:43 +0000 (12:34 -0500)
committerColin Walters <walters@verbum.org>
Thu, 23 Feb 2012 17:34:43 +0000 (12:34 -0500)
We don't want to inherit the permissions of the actual file, otherwise
trying to fetch e.g. /etc/passwd when being served via Apache httpd
will break.

src/libostree/ostree-core.c

index c2dfd11ceee1df4238da51f77bd173bc471a4c9b..9f48c311fbbc93688d8c4cb08458fdc6916f87e9 100644 (file)
@@ -684,7 +684,7 @@ ostree_create_file_from_input (GFile            *dest_file,
   if (g_cancellable_set_error_if_cancelled (cancellable, error))
     return FALSE;
 
-  if (finfo != NULL)
+  if (finfo != NULL && !is_archived_content)
     {
       mode = g_file_info_get_attribute_uint32 (finfo, "unix::mode");
     }